/**
 * 
 */
package com.ihg.hiex.entity.session.before.delegatework;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ihg.hiex.entity.user.Delegate;

/**
 * @author houtao
 *
 */
@Entity
@Table(name = "delegate_wrok_record")
public class DelegateWrokRecord {
    
    @Id
    @GeneratedValue
    private Long id;
    
    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Delegate delegate;
    
    /** 起始日期  */
    private String startDate;
    
    /** 酒店   */
    private String hotel;
    
    /** 城市   */
    private String city;
    
    /** 职位   */
    private String position;
    
    /** 酒店规模 */
    @Enumerated(EnumType.STRING)
    private HotelSize hotelSize;
    
    @Embedded
    @AttributeOverrides({
        @AttributeOverride(name = "department", column = @Column(name = "department")),
        @AttributeOverride(name = "directSubordinate", column = @Column(name = "direct_subordinate")),
        @AttributeOverride(name = "subordinate", column = @Column(name = "subordinate")),
        @AttributeOverride(name = "achievement", column = @Column(name = "achievement"))
    })
    private DelegateWorkRecordInfo info;
    
    /** 序号 */
    private int sort;
    
    /** 是否启用 */
    @Column(name = "is_disabled")
    private boolean disabled;

	/**
	 * the default constructor.
	 */
	public DelegateWrokRecord() {
	}
	
	/**
	 * 
	 * @param delegate
	 * @return
	 */
	public DelegateWrokRecord bind(Delegate delegate) {
		this.delegate = delegate;
		this.disabled = false;
		return this;
	}
	
	/**
	 * 
	 * @param info
	 * @return
	 */
	public DelegateWrokRecord editInfo(DelegateWorkRecordInfo info) {
	    this.info = info;
	    return this;
	}

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the delegate
     */
    public Delegate getDelegate() {
        return delegate;
    }

    /**
     * @return the startDate
     */
    public String getStartDate() {
        return startDate;
    }

    /**
     * @return the hotel
     */
    public String getHotel() {
        return hotel;
    }

    /**
     * @return the city
     */
    public String getCity() {
        return city;
    }

    /**
     * @return the position
     */
    public String getPosition() {
        return position;
    }

    /**
     * @return the hotelSize
     */
    public HotelSize getHotelSize() {
        return hotelSize;
    }

    /**
     * @return the info
     */
    public DelegateWorkRecordInfo getInfo() {
        return info;
    }

    /**
     * @return the sort
     */
    public int getSort() {
        return sort;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param delegate the delegate to set
     */
    public void setDelegate(Delegate delegate) {
        this.delegate = delegate;
    }

    /**
     * @param startDate the startDate to set
     */
    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    /**
     * @param hotel the hotel to set
     */
    public void setHotel(String hotel) {
        this.hotel = hotel;
    }

    /**
     * @param city the city to set
     */
    public void setCity(String city) {
        this.city = city;
    }

    /**
     * @param position the position to set
     */
    public void setPosition(String position) {
        this.position = position;
    }

    /**
     * @param hotelSize the hotelSize to set
     */
    public void setHotelSize(HotelSize hotelSize) {
        this.hotelSize = hotelSize;
    }

    /**
     * @param info the info to set
     */
    public void setInfo(DelegateWorkRecordInfo info) {
        this.info = info;
    }

    /**
     * @param sort the sort to set
     */
    public void setSort(int sort) {
        this.sort = sort;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
}
